import DiscoverDevices from '@/pages/OwnerMain/DiscoverDevices';
import SetupDeviceNetwork from '@/pages/OwnerMain/SetupDeviceNetwork';
import SelectDeviceCategory from '@/pages/OwnerMain/SelectDeviceCategory';
import StationSelection from '@/pages/OwnerMain/Device/components/StationSelection';
import CreatePowerStation from '@/pages/OwnerMain/CreatePowerStation';

const ownerSingleRoutes: ReactNavigation.RouteType[] = [
  {
    name: 'OwnerMain',
    component: require('@/pages/OwnerMain/index').default,
    options: {
      gestureEnabled: false,
      headerShown: false,
    },
  },
  {
    name: 'Scan',
    component: require('@/pages/OwnerMain/Device/components/addDevice')
      .ScanCode,
    options: {
      headerShown: false,
    },
  },
  {
    name: 'UserProfile',
    component: require('@/pages/common/UserProfile').default,
    options: (t) => ({
      title: t('personal.name'),
    }),
  },
  {
    name: 'SNCode',
    component: require('@/pages/OwnerMain/Device/components/addDevice').SNCode,
    options: (t) => ({
      title: t('password.serial.number'),
    }),
  },
  {
    name: 'InstCode',
    component: require('@/pages/InstCode/index').default,
    options: (t) => ({
      headerTitle: t('settings.replaceinstaller'),
    }),
  },
  {
    name: 'DeviceManage',
    component: require('@/pages/OwnerMain/Device/DeviceManage').default,
    options: (t) => ({
      title: t('device.equipment_management'),
      // headerLeft 需要在路由器中动态处理
    }),
  },
  {
    name: 'SelectDeviceCategory',
    component: SelectDeviceCategory,
    options: (t) => ({
      title: t('device.common.add.device'),
    }),
  },
  {
    name: 'General',
    component: require('@/pages/common/General').default,
    options: (t) => ({
      headerTitle: t('common.general'),
    }),
  },
  {
    name: 'AccountSecurity',
    component: require('@/pages/common/Profile/AccountSecurity').default,
    options: (t, theme) => ({
      headerTitle: t('userSetting.account_security'),
      headerStyle: {
        backgroundColor: theme.colors.background,
      },
    }),
  },
  {
    name: 'ChangeEmail',
    component: require('@/pages/common/ChangeEmail').default,
    options: (t) => ({
      headerTitle: t('userSetting.SecuritySettings.form.label.email'),
    }),
  },
  {
    name: 'ChangePassword',
    component: require('@/pages/common/Profile/ChangePassword').default,
    options: (t) => ({
      headerTitle: t('user.changePsd'),
    }),
  },
  {
    name: 'PVChart',
    component: require('@/pages/OwnerMain/Device/PVTimeChart').default,
    options: (t) => ({
      title: t('device.PVdata'),
    }),
  },
  {
    name: 'EquipTimeChart',
    component: require('@/pages/OwnerMain/Device/EquipTimeChart').default,
    options: (t) => ({
      title: t('device.output_power'),
    }),
  },
  {
    name: 'DeviceControl',
    component: require('@/pages/OwnerMain/Device/DeviceControl').default,
    options: (t) => ({
      title: t('device.equipment_control'),
    }),
  },
  {
    name: 'DiscoverDevices',
    component: DiscoverDevices,
    options: (t) => ({
      title: t('sys.app.discover.devices', { defaultValue: '发现设备' }),
    }),
  },
  {
    name: 'SetupDeviceNetwork',
    component: SetupDeviceNetwork,
    options: (t) => ({
      title: t('sys.app.setup.network', { defaultValue: '配网' }),
    }),
  },
  {
    name: 'StationSelection',
    component: StationSelection,
    options: (t) => ({
      title: t('monitor.stat'),
    }),
  },
  {
    name: 'CreatePowerStation',
    component: CreatePowerStation,
    options: t => ({
      title: t('sys.app.station.create', {defaultValue: '新建电站'}),
    }),
  },
];

export default ownerSingleRoutes;
